// 引入
import Vue from 'vue' ;
import VueRouter from 'vue-router';
import App from './components/app.vue';

import Footer from './components/footer.vue';
import Header from './components/header.vue';

import Music from './components/music.vue';
import Guochan from './components/guochan.vue';
import Oumei from './components/oumei.vue';


// 安装
Vue.use(VueRouter);
Vue.component('headerVue', Header);
Vue.component('footerVue', Footer);

// 创建路由对象并配置路由规则
let router = new VueRouter({
    routes : [
        {
            path:'/', redirect:{name:'music'}
        },
        {
            name : 'music',
            path:'/music',
            component : Music,
            children:[
                {name :'oumei', path:'oumei', component:Oumei},
                {name :'guochan', path:'guochan', component:Guochan}
            ]
        }
    ]
});



// 启动
new Vue({
    el : '#app',
    router,
    render:c=>c(App)
});
